package com.mianshi.java01.entity;

// 草莓类
public class Strawberry extends Fruit {
    private boolean isPromotion;

    public Strawberry(boolean isPromotion) {
        super("草莓", 13.0);
        this.isPromotion = isPromotion;
    }

    @Override
    public double getDiscountedPrice() {
        return isPromotion ? getOriginalPrice() * 0.8 : getOriginalPrice();
    }
}
